package cn.itsource.zuul1020.mapper;

import cn.itsource.domain.login.LoginInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LoginInfoMapper extends BaseMapper<LoginInfo> {


    @Select("select * from t_logininfo where username = #{username} or email = #{username} or phone = #{username}")
    LoginInfo login(LoginInfo loginInfo);

    @Select("SELECT role_id as roleId from t_admin_role_employee WHERE employee_id = #{id}")
    Integer findByRoleId(Long id);
    @Select("SELECT t_admin_permission.url FROM t_admin_role_permission JOIN t_admin_permission on t_admin_role_permission.permission_id = t_admin_permission.id WHERE t_admin_role_permission.role_id = #{roleId}")
    List<String> findByPermissions(Integer roleId);
    @Select("select * from t_logininfo where username = #{username}")
    LoginInfo findByUsername(String username);
}
